package com.volcreate.inn.controller;


import com.volcreate.inn.service.impl.BlogService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author zxc
 * @version 0.0.1
 * @date 2020/8/22
 */
@Controller
public class ArchiveController {


    private BlogService blogService;

    public ArchiveController(BlogService blogService) {
        this.blogService = blogService;
    }

    @GetMapping("/archive")
    public String archive(Model model) {
        model.addAttribute("archiveMap", blogService.archiveBlog());
        model.addAttribute("blogCount", blogService.count());
        return "archive";
    }
}
